<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>听雨的个人博客-基于Fastapi和Blazor</title>
    <base href="/" />

    <!--Ant Design Blazor样式-->
    <link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet">
    <script src="_content/AntDesign/js/ant-design-blazor.js"></script>


    <link href="FastapiBlazorBlog.styles.css" rel="stylesheet" />

    <!-- 公共css -->
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="layui/css/layui.css" />
    <link rel="stylesheet" href="css/master.css" />
    <link rel="stylesheet" href="css/gloable.css" />
    <link rel="stylesheet" href="css/nprogress.css" />

    <!-- 代码高亮主题 -->
    <link rel="stylesheet" href="css/atom-one-dark.min.css">
    <!-- Markdown编辑器样式 -->
    <link rel="stylesheet" href="editormd/css/editormd.min.css" />

    <style>
        #app {
            height: 100%;
        }
    </style>

</head>

<body>
    <div id="app">
        <Spin />
        <!-- <Spin Tip="Loading..." /> -->
        <!-- Loading... -->
    </div>

    <!--<div id="blazor-error-ui">
        An unhandled error has occurred.
        <a href="" class="reload">Reload</a>
        <a class="dismiss">🗙</a>
    </div>-->



    <script src="_framework/blazor.webassembly.js"></script>

    <!--公共js-->
    <script src="layui/layui.js"></script>
    <script src="js/yss/gloable.js"></script>
    <script src="js/plugins/nprogress.js"></script>
    <script>NProgress.start();</script>
    <script>
        window.onload = function () {
            NProgress.done();
        };
    </script>
    <script src="js/yss/article.js"></script>
    <script src="js/pagecomment.js"></script>
    <script src="js/pagediary.js"></script>
    <script src="js/pagemessage.js"></script>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <script src="js/plugins/blogbenoitboucart.min.js"></script>


    <!-- 浏览器LocalStorage操作js -->
    <script src="js/LocalStorageHelper.js"></script>

    <!-- 代码高亮js -->
    <script src="js/highlight.min.js"></script>
    <!-- editormd Markdown编辑器 -->
    <script src="editormd/editormd.min.js"></script>
    <script>
        // 代码高亮
        function codeHighlight() {
            document.querySelectorAll('div.content.artiledetail code').forEach(el => {
                hljs.highlightElement(el);
            });
        }

        var mdEditor;
        // 初始化Markdown编辑器
        function initMdEditor() {
            mdEditor = editormd("md-editor", {
                placeholder: "请输入文章内容...",
                width: "100%",
                height: "700px",
                markdown: "",   //清空
                path: "editormd/lib/",
                emoji: true,
                saveHTMLToTextarea: true,   // 保存 HTML 到 Textarea
                //tocm: true, // 支持 [TOCM]
                //tex: true,  // 开启科学公式TeX语言支持，默认关闭
                //flowChart: true,    // 开启流程图支持，默认关闭
                //sequenceDiagram: true,  // 开启时序/序列图支持，默认关闭
                //theme: "dark",  //工具栏主题
                //previewTheme: "dark",   //预览主题
                //imageUpload: false,  //图片上传
            });

        }

        // 获取Markdown编辑器HTML内容
        function getMdHtmlContent() {
            return mdEditor.getHTML();
        }

        // 获取Markdown编辑器Markdown内容
        function getMdMarkdownContent() {
            return mdEditor.getMarkdown();
        }

        // 设置Markdown编辑器的值，方法1
        function setMarkdown1(content) {
            //mdEditor.setMarkdown(content);  // 报错
            mdEditor.markdown = content;
        }

        // 设置Markdown编辑器的值,方法2
        function setMarkdown2(content) {
            mdEditor = editormd("md-editor", {
                placeholder: "请输入文章内容...",
                width: "100%",
                height: "700px",
                path: "editormd/lib/",
                emoji: true,
                saveHTMLToTextarea: true,   // 保存 HTML 到 Textarea
                markdown: content,
            });
        }


    </script>

</body>

</html>